﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="type_process_edit.aspx.cs" Inherits="AnyOffice.general.system.workflow.flow_type.type_process_edit" %>
<%@ Register TagPrefix="cc1" Namespace="PickListControl" Assembly="PickListControl" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>编辑流程步骤 - 基本属性</title>		
		<script language="javascript" src="/aspnet_client/core/function.js"></script>
		<SCRIPT language="javascript">
function check_form()
{
  if(document.Form1.txtPrcsId.value == "")
  {
     alert("序号不能为空！");
     document.Form1.txtPrcsId.focus();
     return false;
  }

  if(!checkIsInteger(document.Form1.txtPrcsId.value))
  {
	alert("序号必须为整数！");
	document.Form1.txtPrcsId.focus();
    return false;
  }

  if(document.Form1.txtPrcsName.value == "")
  {
     alert("步骤名称不能为空！");
     return false;
  }
  
  if(!checkIsInteger(document.Form1.txtTimeout.value))
  {
	alert("办理时限必须为整数！");
	document.Form1.txtTimeout.focus();
    return false;
  }
  
  return true;
}

function ViewWindow(URL)
{
  loc_x=(screen.availWidth-700)/2+20;
  loc_y=(screen.availHeight-550)/2+30;
  URL+="&graph=1";
  window.open(URL,"","height=550,width=700,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+loc_y+",left="+loc_x+",resizable=yes");
}

function auto_set()
{
	if(document.Form1.AutoType.value!="")
   	  lock.style.display="";
   	else
   	  lock.style.display="none";

   if(document.Form1.AutoType.value=="3")
     auto_user_set.style.display="";
   else
   	  auto_user_set.style.display="none";
}

function plugin_view()
{
  if(plugin_text.style.display=='')
     plugin_text.style.display='none';
  else
  	 plugin_text.style.display='';

}

function signChange(obj)
{
	if(obj.value!=1)
		SIGNLOOK.style.display="";
	else
		SIGNLOOK.style.display="none";
}

function myload()
{
    if(document.Form1.Feedback.value!="1")
		SIGNLOOK.style.display="";
	else
		SIGNLOOK.style.display="none";
		
	auto_set();
}


function LoadWindow()
{
  URL="user_select.aspx?id=<%=ViewState["Id"] %>";
  loc_x=document.body.scrollLeft+event.clientX-event.offsetX;
  loc_y=document.body.scrollTop+event.clientY-event.offsetY;
  window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:380px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
	</SCRIPT>
	</HEAD>
	<body class="bodycolor" topmargin="5" onload="myload();">
		<form id="Form1" method="post" runat="server">
		<asp:Panel ID="pnlMain" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/edit.gif" align="absMiddle"><span class="big3">
							编辑流程步骤 - 基本属性</span><br>
					</td>
				</tr>
			</table>			
			<table border="0" width="90%" cellpadding="2" cellspacing="1" align="center" class="small" bgcolor="#000000">
				<tr>
					<td nowrap class="TableData">序号：</td>
					<td class="TableData">
						<asp:TextBox id="txtPrcsId" runat="server" Columns="2" CssClass="BigInput" MaxLength="4"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">步骤名称：</td>
					<td class="TableData">
						<asp:TextBox id="txtPrcsName" runat="server" Columns="30" CssClass="BigInput" MaxLength="100"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">下一步骤：</td>
					<td class="TableData">
						可以选择多个分支步骤，如不选择，则系统自动按顺序寻找下一步骤
						<TABLE class="big" cellSpacing="0" borderColorDark="#ffffff" cellPadding="3" width="450"
							borderColorLight="#000000" border="1">
							<TR bgColor="#cccccc">
								<TD align="center" width="210"><B>下一步骤</B></TD>
								<TD align="center" width="50">选择</TD>
								<TD align="center" width="190"><B>备选步骤</B></TD>
							</TR>
							<TR>
								<TD vAlign="top" align="center" bgColor="#cccccc" colSpan="3">
									<cc1:PickList id="pklMyTable" runat="server" Height="250px" Width="450px" FormID="Form1" IsMoveItemRight="False"></cc1:PickList></TD>
							</TR>
						</TABLE>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">公共附件选项：</td>
					<td class="TableData">
						<asp:DropDownList ID="ddlAttachmentFlag" runat="server" CssClass="SmallSelect">
                            <asp:ListItem Value="0">允许删除</asp:ListItem>
                            <asp:ListItem Value="1">禁止删除</asp:ListItem>
                        </asp:DropDownList>
					</td>
				</tr>
				
				<tr>
                  <td nowrap class="TableData">会签选项：</td>
                  <td class="TableData">
                    <b>是否允许会签：</b>
                    <select id="Feedback" name="Feedback" onchange="javascript:signChange(this);" class="SmallSelect" runat="server">
                      <option value="0">允许会签</option>
                      <option value="1">禁止会签</option>
                      <option value="2">强制会签</option>
                    </select>&nbsp;说明：如设置强制会签，则不会签不能进行办理完毕操作
                     <div id="SIGNLOOK">
                        <b>是否允许查看其他人的会签意见：</b>
                        <select id="SignLook" name="SignLook" class="SmallSelect" runat="server">
                          <option value="0">是</option>
                          <option value="1">否</option>
                        </select>
                     </div>                 
                  </td>
                </tr>
                
                 <tr>
    	            <td class="TableData">强制转交：</td>
    	            <td class="TableData">
    		            <b>经办人未办理完毕时是否允许主办人强制转交：</b>
    	             <select id="TurnPriv" name="TurnPriv" class="SmallSelect" runat="server">
       	            <option value="1">允许</option>
       	            <option value="0">不允许</option>
      	            </select>
      	            </td>
                  </tr>
                  
                  <tr>
                     <td class="TableData">转交时邮件自动通知以下人员：</td>
                      <td class="TableData">
                        <input type="hidden" id="MailTo" name="MailTo" value="" runat="server">
                        <textarea cols=35 id="MailToName" name="MailToName" rows=2 class="BigStatic" wrap="yes" readonly runat="server"></textarea>
                        &nbsp;<input type="button" value="选 择" class="SmallButton" onClick="user_select('MailTo','MailToName')" title="选择人员" name="button">
                        &nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_double('MailTo','MailToName')" title="清空人员" name="button">
                      </td>
                    </tr>  
    			
    			<tr>
                  <td nowrap class="TableData">步骤经办人：<br></td>
                  <td class="TableData">
                            <b>经办权限设置：</b>
                      <input type=button class=SmallButton onclick="javascript:ViewWindow('type_process_user.aspx?flow_id=<%=ViewState["FlowId"] %>&id=<%=ViewState["Id"] %>')" value="指定经办权限">&nbsp;
                      经办权限为人员、部门、角色的合集
                      <br>
                   
      	            <b>选人过滤规则：</b>
                    <select id="UserFilter" name="UserFilter" class="SmallSelect" runat="server">
        	          <option value="0">允许选择全部指定的经办人</option>
                      <option value="1">只允许选择本部门经办人</option>
                      <option value="2">只允许选择本角色经办人</option>
                    </select>
                    默认设置为：允许选择全部指定的经办人<br>
                    <b>自动选人规则：</b>
                    <select id="AutoType" name="AutoType" class="SmallSelect" onchange="auto_set()" runat="server">
        	          <option value="0" >不进行自动选择</option>
                      <option value="1" >自动选择流程发起人</option>
                      <option value="2" >自动选择本部门主管</option>
                      <option value="4" >自动选择上级部门主管</option>
                      <option value="5" >自动选择一级部门主管</option>
                      <option value="3" >指定自动选人默认人员</option>
                    </select>
                    默认设置为：不进行自动选择<br>
                   <div id="lock" style="display:none">
                   <b>是否允许更改指定经办人及相关选项：</b>
                   <select class="SmallSelect" id="UserLock" name="UserLock" runat="server">
       	            <option value="1">允许</option>
       	            <option value="0">不允许</option>
      	            </select>
                   </div>
                   <input type="checkbox" name="TopDefault" id="TopDefault" runat="server"><b>默认由最先接收的人办理</b>
                  </td>
                </tr>
                <tr id="auto_user_set" style="display:none">
                  <td class="TableLine1" colspan=2>
                  &nbsp;<b>主办人：</b>
                  <input type="text" id="AutoUserOpName" name="AutoUserOpName" value="" size="10" class="SmallStatic" readonly runat="server">
                  <input type="hidden" id="AutoUserOp" name="AutoUserOp" value="" runat="server">
                  <font color=red>主办人是某步骤的负责人，只允许主办人编辑表单、公共附件和转交流程</font><br>
                  &nbsp;<b>经办人：</b>
                  <textarea cols=40 id="AutoUserName" name="AutoUserName" rows="4" class="BigStatic" wrap="yes" readonly runat="server"></textarea>
                  <input type="hidden" id="AutoUser" name="AutoUser" value="" runat="server">
                  <input type="button" value="指定经办/主办人" class="SmallButton" onClick="LoadWindow();" title="指定经办人和主办人" name="button">
                  <input type="button" value="清空" class="SmallButton" onClick="clear_double('AutoUserOp','AutoUserOpName');clear_double('AutoUser','AutoUserName');" title="清空经办人和主办人" name="button">
                </td>
                  </tr>
      
				<tr>
					<td nowrap class="TableData">办理时限：</td>
					<td class="TableData">
                    <asp:TextBox ID="txtTimeout" runat="server" Columns="4" CssClass="BigInput" MaxLength="4"></asp:TextBox>
                    小时，表示接收工作后办理的时限，为空表示不限时
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">插件程序名称：</td>
					<td class="TableData">
						<asp:TextBox id="txtPlugin" runat="server" Columns="20" CssClass="BigInput" MaxLength="200"></asp:TextBox>
						一般无需填写 <a href="javascript:plugin_view()">查看填写说明</a><br>
						<div id="plugin_text" style="display:none">
						如没有软件开发商特殊定制开发的的插件程序，请勿填写。插件程序为ASPX文件，例如：my_process.aspx，放置于webroot/general/workflow/plugin下。插件程序将在本步骤执行完毕后被自动调用执行。</div>
					</td>
				</tr>
				<tr align="center" class="TableControl">
					<td colspan="2" nowrap>
						<input type="submit" value="保存" class="BigButton" name="submit" onclick="return check_form();">&nbsp;&nbsp;&nbsp;&nbsp;
						<asp:Literal id="litButton" runat="server"></asp:Literal>
					</td>
				</tr>
			</table>
			<br />
            </asp:Panel>
            <asp:Literal ID="litMessage" runat="server"></asp:Literal>         
		</form>
	</body>
</HTML>
